<template>
  <div>
    <!-- 有数据 -->
    <div class="list" v-if="arr.length > 0">
      <van-card
      v-for="item in arr"
      :key="item.id"
       @click="$router.push('/detail/'+item.id)"
        :price="item.price"
       
        :title="item.goodsname"
        :thumb="$pre+ item.img"
      />
      <!-- <div
        class="item" v-for="item in arr" :key="item.id" is="router-link" :to="'/detail/'+item.id"
      >
        <img :src="$pre+ item.img" alt="" />
        <div class="right">
          <h3>{{ item.goodsname }}</h3>
          <div>price:{{ item.price }}</div>
        </div>
      </div> -->
    </div>
    <!-- 无数据 -->
    <van-empty v-else description="暂无数据" />
    <!-- <div v-else>暂无数据</div> -->
  </div>
</template>

<script>
import { Empty } from "vant";
export default {
  props: ["arr"],
};
</script>

<style scoped>

</style>